<!--:include("start.html"){}  -->
<link href="https://cdn.bootcss.com/bootstrap-select/2.0.0-beta1/css/bootstrap-select.min.css" rel="stylesheet">
<link rel="stylesheet" href="${root}assets/plugins/dropify/dist/css/dropify.min.css">
                <div class="row">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-body">
                                <h4 class="card-title">${isEmpty(obj.id)?"新增":"编辑"}量表</h4>
                                <h6 class="card-subtitle"></h6>
<form class="form-horizontal m-t-40" enctype="multipart/form-data" action="save" method="post">
<div class="form-group ">
  <label for="example-text-input" class="col-2 col-form-label">名称</label>
  <div class="col-10">
  	<input type="hidden" name="id" value="${obj.id!}" />
  	<input type="hidden" name=".table" value="cp_lb" />
  	<input type="hidden" name="opby" value="${session.admin.id!0}" >
    <input class="form-control" type="text" name="name" value="${obj.name!}" >
  </div>
</div>
<div class="form-group ">
  <label for="example-text-input" class="col-3 col-form-label">维度</label>
  
  <label for="example-text-input" class="col-3 col-form-label">虚拟访问</label>
  
  <label for="example-text-input" class="col-3 col-form-label">真实访问</label>
  <div class="col-3">
  </div>
</div>
<div class="form-group row">
<div class="col-3" style="margin-left: 15px;" >
    <select name="wd_ids" class="selectpicker" multiple title="请选择" data-live-search="true">
    	<!--:for(wd in wds!){  -->
    	<option value="${wd.id}">${wd.name!}</option>
    	<!--:}  -->
    </select>
  </div>
  <div class="col-3">
    <input class="form-control" name="vnum" type="number" value="${obj.vnum!0}" >
  </div>
  <div class="col-3">
    <input class="form-control" name="rnum" type="number" value="${obj.rnum!0}" >
  </div>
  <div class="col-3">
  </div>
</div>

<div class="form-group " >
  <label for="example-text-input" class="col-3 col-form-label">信效度</label>
  <label for="example-text-input" class="col-3 col-form-label">价格</label>
  
</div>
<div class="form-group row" >
<div class="col-3" style="margin-left: 15px;">
    <input class="form-control" name="trust" type="number" value="${obj.trust!1.00}" >
  </div>
 <div class="col-3">
    <input class="form-control" name="price" type="number" value="${obj.price!0}" >
  </div>
</div>
<div class="form-group" >
	<div class="card">
         <div class="card-body">
             <h4 class="card-title">封面图</h4>
             <label for="input-file-now">选择封面图</label>
             <input type="file" value="${obj.img!}" name="img" class="dropify" />
         </div>
     </div>
</div>
<div class="form-group ">
  <label for="example-text-input" class="col-2 col-form-label">引导语</label>
  <div class="col-10">
    <textarea name="guide" class="form-control" rows="3">${obj.guide!}</textarea>
  </div>
</div>
<div class="form-group">
  <label for="example-text-input" class="col-2 col-form-label">备注</label>
  <div class="col-10">
    <textarea name="remark" class="form-control" rows="3">${obj.remark!}</textarea>
  </div>
</div>
<div class="form-group m-b-0">
  <div class="offset-sm-3 col-sm-9">
    <button type="submit" class="btn btn-info waves-effect waves-light m-t-10">保存</button>
    <button type="button" onclick="history.go(-1);" class="btn btn-danger waves-effect waves-light m-t-10">取消</button>
  </div>
</div>
</form>

</div>
</div>
</div>
</div>
<!--:include("end.html"){}  -->
<script src="https://cdn.bootcss.com/bootstrap-select/2.0.0-beta1/js/bootstrap-select.min.js"></script>
<!-- jQuery file upload -->
    <script src="${root}assets/plugins/dropify/dist/js/dropify.min.js"></script>
    <script>
    $(document).ready(function() {
    	
    	//选择
    	$('.selectpicker').selectpicker('val',${obj.wd_ids!""});
    	
        // Basic
        $('.dropify').dropify();

        // Translated
        $('.dropify-fr').dropify({
            messages: {
                default: 'Glissez-déposez un fichier ici ou cliquez',
                replace: 'Glissez-déposez un fichier ou cliquez pour remplacer',
                remove: 'Supprimer',
                error: 'Désolé, le fichier trop volumineux'
            }
        });

        // Used events
        var drEvent = $('#input-file-events').dropify();

        drEvent.on('dropify.beforeClear', function(event, element) {
            return confirm("Do you really want to delete \"" + element.file.name + "\" ?");
        });

        drEvent.on('dropify.afterClear', function(event, element) {
            alert('File deleted');
        });

        drEvent.on('dropify.errors', function(event, element) {
            console.log('Has Errors');
        });

        var drDestroy = $('#input-file-to-destroy').dropify();
        drDestroy = drDestroy.data('dropify')
        $('#toggleDropify').on('click', function(e) {
            e.preventDefault();
            if (drDestroy.isDropified()) {
                drDestroy.destroy();
            } else {
                drDestroy.init();
            }
        })
    });
    </script>